# -*- coding: utf-8 -*-

"""
@author: Laowang
@contact: QQ:1125564921
@Created on: 2022/6/21
@Remark: 
"""

import time
import hmac
import requests
import hashlib
import json
import base64
import urllib.parse
from functools import wraps
from typing import Dict

from framework_strategy.gopy.gateways.utils import RequestParamterObj, request, ResponseEventObj


def public_request_(this, event, parameter):
    # _, event_data = parameter.data, parameter.data.event_data
    # params = event_data.kwargs
    # try:res
    #     res = request(parameter.method, parameter.uri, params, this.proxy)
    # except (requests.exceptions.HTTPError, requests.exceptions.ConnectTimeout) as err:  # NOQA
    #     res = False, None, None
    
    # bool, parameter.method, response, event
    res = parameter.method
    if res == [] or res:
        params = [True, res, 'success', event]
    else:
        params = [False, res, 'failed', event]
    res = ResponseEventObj(*params)
    return res
